<meta charset="utf-8">
<?php
    header('Content-type:text/html;charset=utf-8');
    function fun($name,$age='未知',$add='地址不详')
    {
        echo '姓名:'.$name.'<br>';
        echo '年龄:'.$age.'<br>';
        echo 'dizhi:'.$add.'<br>';
    }
    fun('李白',20,'beijing');
    fun('李白');
?>
<?php
    function fun1($args)
    {
        $args="测试 中";

    }
$array=array('sd','sb');
fun1($array);
function fun2(&$args)
{
    $args="测试中";

}
$array=array('tom','jack');
fun2($array);
var_dump($array);
?>
<?php
    define('name','xxxx');
?>
<?php
    $_GET['num']=10;
function a()
{
    echo $_GET['num']+20,'<hr>';
}

$num1=10;
function b()
{
    $GLOBALS['num1'];
    echo $GLOBALS['num1']+20,'<hr>';
}
$num2 =5;
function c()
{
    global $num2;
    echo $num2+20,'<hr>';

}
a();
b();
c();
?>
<?php
function fun3()
{
    $_GET['a']='hah';
}
fun3();
echo $_GET['a'],'<br>';

?>
<?php
function cd($f)
{
    if($f==1)
    {
        return 1;
    }
    else
    {
        return $f *cd($f-1);
    }
}
cd(10);
?>





















